/**
 * 
 */
package tests.acceptanceTests;


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;


import sourceFiles.Application;
import sourceFiles.CentralComputer;
import sourceFiles.IRide;
import sourceFiles.SupervisorStation;

/**
 * @author Argaman
 * 
 */
public class AcceptanceTests {

	/**
	 * This is a general class for all the other acceptance tests to inherit
	 * from. This class contains all the data needed for the tests and from this
	 * class the setUp() function of all the other tests will get it's data.
	 */

	protected String password;
	protected final int AGE = 5;
	protected final int HEIGHT = 130;
	
	protected String[] rideNames = { "ride1", "ride2", "ride3", "ride4",
			"ride5", "ride6", "ride7", "ride8", "ride9", "ride10" };

	protected int[] IDs = { 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 1010  };

	protected int billingInfo = 12345;

	protected static CentralComputer centralComputer;

	protected static SupervisorStation supervisorStation;

	protected IRide ride;
	
	protected static Application application;

	protected static String masterXMLFilePath;

	protected final static String IN_PROJECT_PATH_TO_TESTS = "\\src\\tests";

	protected static String copyXMLFilePath;

	protected static final Boolean EXTREME = true;

	protected static final Boolean NOT_EXTREME = false;

	/**
	 * @throws FileNotFoundException
	 *             if the XML hadn't found the file.
	 * @throws IOException
	 *             in IO errors
	 * 
	 *             This copies the file to an XML file fir us to work on.
	 */
	protected void copySourceFile() throws FileNotFoundException, IOException {
		InputStream inStream = null;
		OutputStream outStream = null;

		File afile = new File(masterXMLFilePath);
		File bfile = new File(copyXMLFilePath);

		inStream = new FileInputStream(afile);
		outStream = new FileOutputStream(bfile);

		byte[] buffer = new byte[1024];

		int length;
		// copy the file content in bytes
		while ((length = inStream.read(buffer)) > 0) {

			outStream.write(buffer, 0, length);
		}
		inStream.close();
		outStream.close();
	}

}
